<template>
	<view class="list">
		<view class="list_item" v-for="(item, index) in opt_list" @click="navTo('/pages/help/detail?id=' + item.id)">
			<view class="item_l">
				<text>{{item.title}}</text>
			</view>
			<view class="item_r">
				<image src="/static/img/detail/right.png" mode="widthFix"></image>
			</view>
		</view>
		
		
	</view>
</template>

<script>
	import {
		ment,
	} from '../../api/api.js';
	export default {
		data() {
			return {
				opt_list: []
			};
		},
		onLoad() {
			// uni.hideHomeButton()
			if (uni.getStorageSync('config')) {
				this.opt_list = uni.getStorageSync('config').opt_list;
			} else {
				this.getMent();
			}

		},
		methods: {
			navTo(uri) {
				console.log(uri)
				uni.navigateTo({
					url: uri
				});
			},
			getMent() {
				ment().then(res => {

					this.opt_list = res.data.opt_list;
					uni.setStorageSync('config', res.data);
				});
			},
		}
	}
</script>

<style lang="less">
	.list {
		width: 100%;
		margin-top: 20upx;
		background-color: #ffffff;

		.list_item {
			width: 90%;
			margin: 0 auto;
			height: 90upx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-bottom: 1upx solid #f8f6f7;

			image {
				width: 30upx;
			}

			.item_l {
				min-width: 100upx;
				display: flex;
				justify-content: space-between;
				align-items: center;

				image {
					margin-right: 20upx;
				}
			}

			.item_r {
				image {
					width: 15upx;
				}
			}
		}
	}
</style>
